package com.bsy.network.interceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * @author Sincerity
 * @date   2023/3/27 07:26
 * @desc   Cookies拦截器
 */
class HostsInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val original=chain.request()
        val newUrl=original.url.newBuilder().host("172.16.99.111 bs-saas.server.gateway.com").build()
        val completeRequest=original.newBuilder().url(newUrl).build()
        val  requestBuilder=completeRequest.newBuilder()
        val request=requestBuilder.build()
        return chain.proceed(request)
    }
}

